﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

using JM.JCY.Common;
using JM.JCY.DataAccess;
using JM.JCY.BusinessEntity;

namespace JM.JCY.BusinessComponent
{
    public class NewsfeedBC : JCYBusinessComponentBase<NewsfeedDA>
    {
        public NewsfeedBC()
            : base(new NewsfeedDA())
        {
        }
        public NewsfeedDataSet.T_FeedPostDataTable GetFeedPost(string appType, int appId, string excludePostId)
        {
            return this.DataAccess.GetFeedPost(appType, appId, excludePostId);
        }

        public NewsfeedDataSet.T_FeedPostDataTable GetMoreFeedPost(string appType, int appId, string excludePostId)
        {
            return this.DataAccess.GetMoreFeedPost(appType, appId, excludePostId);
        }

        public void InsertFeedPost(NewsfeedDataSet ds)
        {
            this.DataAccess.InsertFeedPost(ds);
        }

        public NewsfeedDataSet.T_FeedPostDataTable GetFeedPostEntity(int feedPostId)
        {
            return this.DataAccess.GetFeedPostEntity(feedPostId);
        }

        public NewsfeedDataSet.T_FeedPostDataTable GetFeedPostByObjectId(int objId)
        {
            return this.DataAccess.GetFeedPostByObjectId(objId);
        }

        public NewsfeedDataSet.T_FeedCommentDataTable InsertComment(NewsfeedDataSet ds)
        {
            return this.DataAccess.InsertComment(ds);
        }

        public NewsfeedDataSet.T_FeedCommentDataTable GetFeedCommentEntity(int commentId)
        {
            return this.DataAccess.GetFeedCommentEntity(commentId);
        }

        public NewsfeedDataSet.T_FeedCommentDataTable GetMoreCommentsByObj(int objId, int dataNum)
        {
            return this.DataAccess.GetMoreCommentsByObj(objId, dataNum);
        }

        public NewsfeedDataSet.T_FeedCommentDataTable GetFeedCommentByNewsfeedId(int newsfeedId)
        {
            return this.DataAccess.GetFeedCommentByNewsfeedId(newsfeedId);
        }
        public bool DeletePostCommentById(int commentId)
        {
            return this.DataAccess.DeletePostCommentById(commentId);
        }

        public DateTime GetFeedPostLastestUpdateTime(int feedPostId)
        {
            return this.DataAccess.GetFeedPostLastestUpdateTime(feedPostId);
        }

        public NewsfeedDataSet.T_FeedCommentDataTable GetPostCommentByPostId(int feedpostId, int dataNum)
        {
            return this.DataAccess.GetPostCommentByPostId(feedpostId, dataNum);
        }

        public void DeleteFeedPost(int feedpostId)
        {
            this.DataAccess.DeleteFeedPost(feedpostId);
        }

        public DateTime GetLatestFeedPostUpdateTime(string appType, int appId)
        {
            return this.DataAccess.GetLatestFeedPostUpdateTime(appType, appId);
        }

        public NewsfeedDataSet.T_UserInfoDataTable GetUserInfoEntity(int userId)
        {
            return this.DataAccess.GetUserInfoEntity(userId);
        }
    }
}
